﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace S.BreedingHistory.Infrastructure
{
    /// <summary>
    /// 基础异步的增删改查
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IBaseRepository<T>
    {
        /// <summary>
        /// 异步添加
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task<bool> AddAsync(T t);
        /// <summary>
        /// 异步修改
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task<bool> UpdateAsync(T t);
        /// <summary>
        /// 异步删除
        /// </summary>
        /// <param name="id">要删除的某条数据的主键</param>
        /// <returns></returns>
        Task<bool> DeleteAsync(int id);
        /// <summary>
        /// 异步显示
        /// </summary>
        /// <returns></returns>
        Task<List<T>> GetAllAsync();

    }
}
